package org.zht.dormpro.dorm.mapper;

import org.apache.ibatis.annotations.*;
import org.zht.dormpro.auth.bean.PageBean;
import org.zht.dormpro.dorm.bean.ClassDTO;
import org.zht.dormpro.dorm.model.TbClass;
import org.zht.dormpro.dorm.model.TbCollege;
import org.zht.dormpro.dorm.model.TbMajor;

import java.util.List;

public interface TbClassMapper {
    @Delete({"delete from tb_class where id = #{id,jdbcType=INTEGER}"})
    int deleteByPrimaryKey(Integer id);


    int insertSelective(TbClass record);

    @Select({
        "select",
        "id, cla_id, maj_id, cla_name, cla_remark, cla_append, cla_status",
        "from tb_class",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("org.zht.dormpro.dorm.mapper.TbClassMapper.BaseResultMap")
    TbClass selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TbClass record);

    List<ClassDTO> getAllClassByCondition(PageBean pageBean);

    List<TbClass> getAllClass(@Param("all") int all);

    List<TbClass> getAllClassByMajId(@Param("majId") String majId);
}